Skip to main content

Register

POST /auth/register

Description

Creates a new local DayKeeper account and sends an email verification code. The user is created with verified_email: false until the confirmation step is completed.

Request Parameters

Requires Authentication: false

BODY

NameTypeRequiredDescription
usernamestringYesUsername for the new account. Lowercase letters, numbers, . and _ only.
emailstringYesEmail address for the account.
passwordstringYesPassword for local authentication.
timeZonestringNoIANA timezone. Defaults to the API default timezone.

Validation Notes

  • username, email, and password are required.
  • Uppercase usernames are rejected.
  • Forbidden usernames such as reserved route names are rejected.
  • Duplicate email or username returns 409.
  • Banned emails return 403.

Usage Example

await axios.post("https://api.daykeeper.app/auth/register", {
username: "johndoe",
email: "johndoe@example.com",
password: "MyPassword1234",
timeZone: "America/New_York",
})

Success Response

{
"message": "johndoe created successfully",
"user": {
"_id": "65cbaab84b9d1cce41e98b60",
"username": "johndoe",
"email": "johndoe@example.com",
"verified_email": false
}
}

Error Response

CodeDescription
400Invalid input or missing required fields
403Banned email or forbidden username
409Username or email already registered
413Username or password too long
500Server error

Example

{
"message": "This username or email has already been registered"
}